<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style> 
    *{
        margin: 0;
        padding: 0;
    }

    body{
        width: 3000px;
        height: 3000px;
    }

    div{
        width: 500px;
        height: 500px;
        background-color: skyblue;
        margin: 50px;
    }
    </style>
</head>
<body>
    <div>

    </div>

    <script>
        var ele = document.querySelector('div');

        ele.onclick = function(event){
            console.log('offsetx',event.offsetX);
            console.log('offsetx',event.offsetY);

            console.log('clientx',event.clientX);
            console.log('clienty',event.clientY);


            console.log('pagex',event.pageX);
            console.log('pagey',event.pageY);


        }
    </script>
</body>
</html>